<template>
  <div class="layout-container-demo">
    
    <el-container>
      <el-header style="font-size: 12px">
        <div class="toolbar">
          <span class="left-wrapper">
            <span class="slotTitle">
              <slot>默认标题</slot>
            </span>

          </span>
          <div class="right-wrapper">
            <el-dropdown class="right-content">
              <el-icon  style="margin-right: 8px; margin-top: 1px"
                ><setting
              /></el-icon>
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item>View</el-dropdown-item>
                  <el-dropdown-item>Add</el-dropdown-item>
                  <el-dropdown-item>Delete</el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
            <span class="right-content">Tom</span>
          </div>
        </div>
      </el-header>
    </el-container>
  </div>
</template>

<script lang="ts" setup>
import { Menu as IconMenu, Message, Setting } from '@element-plus/icons-vue'

</script>

<style scoped>
.layout-container-demo{
  position: sticky;
  top: 0;
  z-index: 100;
}
.layout-container-demo .el-header {
  background-color: white;
  width: 100%;
  color: var(--el-text-color-primary);
  border-bottom: 1px solid #ebeef5;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05);
}
.layout-container-demo .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;;
  height: 100%;
  right: 20px;
}

.slotTitle{
  font-size: 20px;
  font-weight: bold;
  color: var(--el-text-color-primary);
  margin-right: 20px;
  margin-left: 20px;
  padding: 10px;
  cursor: pointer;
}

.left-wrapper,
  .right-wrapper {
    display: flex; /* 创建一个新的flex容器 */
  }
  
  .left-content,
  .right-content {
    /* 这里可以添加任何必要的样式 */
  }
</style>